package com.shopcz.mx.shopcar.manager;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.shopcz.mx.shopcar.service.CarService;
import com.shopcz.pojo.shopCar;

public class UpdateCarInfoServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
       this.doPost(request, response);
	}


	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		int carId = Integer.parseInt(request.getParameter("carId"));
		int newNum = Integer.parseInt(request.getParameter("newNum"));
		CarService carservice=new CarService();
		shopCar car=new shopCar();
		car.setCarId(carId);
		car.setShopNum(newNum);
		//System.out.println("carservice.updateService(car)......");
		if(carservice.updateService(car)){
			response.sendRedirect("carInfoServlet");		
		}
		
	}



}
